#include <bits/stdc++.h>

using namespace std;

int a[5010],b,c[5010],la,lc;
int main()
{
    string q;
    cin>>q>>b;
    la = q.length();
    for(int i =1;i<=la;i++){
        a[i] = q[la-i]-'0';
    }

    int yu = 0;
    for(int i=la;i>=1;i--){
        c[i] = (a[i]+yu*10LL)/b;
        yu = (a[i]+yu*10LL)%b;
    }
    lc = la;
    while(c[lc]==0&&lc>1){
        lc--;
    }
    for(int i=lc;i>=1;i--){
        cout << c[i];
    }
    return 0;
}
